package com.shadow.baiqun.delegate.room.check;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.shadow.ui.recycler.ObjConverter;

/**
 * @author zy
 * on 2018/6/26
 */
public class BoardCodeDataConverter {
    public BoardInfoEntity convert(String response) {
        BoardInfoEntity boardInfoEntity;
        try {
            final JSONObject jsonObject = JSONObject.parseObject(response);
            String dataStr = jsonObject.getString("rows");
            boardInfoEntity = new ObjConverter<BoardInfoEntity>().
                    convert(dataStr, new TypeReference<BoardInfoEntity>() {
                    });
            return boardInfoEntity;
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
}
